Learning Asynchronous Typestates for Android Classes

نویسندگان

  • Arjun Radhakrishna
  • Nicholas V. Lewchenko
  • Shawn Meier
  • Sergio Mover
  • Krishna Chaitanya Sripada
  • Damien Zufferey
  • Bor-Yuh Evan Chang
  • Pavol Cerný
چکیده

In event-driven programming frameworks, such as Android, the client and the framework interact using callins (framework methods that the client invokes) and callbacks (client methods that the framework invokes). The protocols for interacting with these frameworks can often be described by finite-state machines we dub asynchronous typestates. Asynchronous typestates are akin to classical typestates, with the key difference that their outputs (callbacks) are produced asynchronously. We present an algorithm to infer asynchronous typestates for Android framework classes. It is based on the L∗ algorithm that uses membership and equivalence queries. We show how to implement these queries for Android classes. Membership queries are implemented using testing. Under realistic assumptions, equivalence queries can be implemented using membership queries. We provide an improved algorithm for equivalence queries that is better suited for our application than the algorithms from literature. Instead of using a bound on the size of the typestate to be learned, our algorithm uses a distinguisher bound. The distinguisher bound quantifies how two states in the typestate are locally different. We implement our approach and evaluate it empirically. We use our tool, Starling, to learn asynchronous typestates for Android classes both for cases where one is already provided by the documentation, and for cases where the documentation is unclear. The results show that Starling learns asynchronous typestates accurately and efficiently. Additionally, in several cases, the synthesized asynchronous typestates uncovered surprising and undocumented behaviors.

برای دانلود رایگان متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

Synthesis of Interface Specifications for Android Classes

Event-driven programming frameworks interact with client code using callins (framework methods that the client invokes) and callbacks (client methods that the framework invokes). The protocols for interacting with such frameworks can often be described by finite-state machines we dub asynchronous typestates. Asynchronous typestates are akin to classical typestates, with the key difference that ...

متن کامل

Leveraging the Web for Synchronous Versus Asynchronous Distance Learning

This paper reports on the authors’ experiences in designing and teaching synchronous distance learning classes in electrical and computer engineering and in designing asynchronous distance learning classes for a graduate program in information technology. These experiences provide insight into the characteristics, benefits, and limitations of these two modes of distance learning. These characte...

متن کامل

Efficient Android Threading - Asynchronous Processing Techniques for Android Applications

Spend your few moment to read a book even only few pages. Reading book is not obligation and force for everybody. When you don't want to read, you can get punishment from the publisher. Read a book becomes a choice of your different characteristics. Many people with reading habit will always be enjoyable to read, or on the contrary. For some reasons, this efficient android threading asynchronou...

متن کامل

Deriving Object Typestates

We are interested in static analysis of Java classes with the goal of discovering the preconditions under which a certain program point within a method may be reached, taking into account the effects of previous method calls on an object of that class. The information pertinent to this computation is represented as the object’s typestate, which is a finite set of relevant predicates that abstra...

متن کامل

PersisDroid: Android Performance Diagnosis via Anatomizing Asynchronous Executions

Android applications (apps) grow dramatically in recent years. Apps are user interface (UI) centric typically. Rapid UI responsiveness is key consideration to app developers. However, we still lack a handy tool for profiling app performance so as to diagnose performance problems. This paper presents PersisDroid, a tool specifically designed for this task. The key notion of PersisDroid is that t...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

عنوان ژورنال:
  • CoRR

دوره abs/1701.07842  شماره 

صفحات  -

تاریخ انتشار 2017